home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Entertainment / MacMud / Unix / netdb.h.42 < prev    next >
Encoding:
Text File  |  1989-02-22  |  1.9 KB  |  72 lines  |  [TEXT/????]

  1. /*
  2. *      hacks for nameserver/sendmail
  3. */
  4. /*
  5.  * Error return codes from gethostbyname() and gethostbyaddr()
  6.  */
  7.  
  8. extern  int h_errno;    
  9.  
  10. #define    HOST_NOT_FOUND    1 /* Authoritive Answer Host not found */
  11. #define    TRY_AGAIN    2 /* Non-Authoritive Host not found, or SERVERFAIL */
  12. #define    NO_RECOVERY    3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  13. #define NO_ADDRESS    4 /* Valid host name, no address, look for MX record */
  14. #define NO_DATA NO_ADDRESS
  15.  
  16. /*
  17. *   end of the hacks
  18. */
  19.  
  20.  
  21. /*    netdb.h    1.2    86/07/18    */
  22. /*
  23.  * Structures returned by network
  24.  * data base library.  All addresses
  25.  * are supplied in host order, and
  26.  * returned in network order (suitable
  27.  * for use in system calls).
  28.  */
  29. struct    hostent {
  30.     char    *h_name;    /* official name of host */
  31.     char    **h_aliases;    /* alias list */
  32.     int    h_addrtype;    /* host address type */
  33.     int    h_length;    /* length of address */
  34.     char    *h_addr;    /* address */
  35. };
  36.  
  37. /*
  38.  * Assumption here is that a network number
  39.  * fits in 32 bits -- probably a poor one.
  40.  */
  41. struct    netent {
  42.     char    *n_name;    /* official name of net */
  43.     char    **n_aliases;    /* alias list */
  44.     int    n_addrtype;    /* net address type */
  45.     int    n_net;        /* network # */
  46. };
  47.  
  48. struct    servent {
  49.     char    *s_name;    /* official service name */
  50.     char    **s_aliases;    /* alias list */
  51.     int    s_port;        /* port # */
  52.     char    *s_proto;    /* protocol to use */
  53. };
  54.  
  55. struct    protoent {
  56.     char    *p_name;    /* official protocol name */
  57.     char    **p_aliases;    /* alias list */
  58.     int    p_proto;    /* protocol # */
  59. };
  60.  
  61. struct rpcent {
  62.     char    *r_name;        /* name of server for this rpc program */
  63.     char    **r_aliases;    /* alias list */
  64.     int     r_number;       /* rpc program number */
  65. };
  66.  
  67. struct hostent    *gethostbyname(), *gethostbyaddr(), *gethostent();
  68. struct netent    *getnetbyname(), *getnetbyaddr(), *getnetent();
  69. struct servent    *getservbyname(), *getservbyport(), *getservent();
  70. struct protoent    *getprotobyname(), *getprotobynumber(), *getprotoent();
  71. struct rpcent    *getrpcbyname(), *getrpcbynumber(), *getrpcent();
  72.